package cn.edu.yzu.scholarship.controller;

import java.util.ArrayList;
import java.util.List;

import cn.edu.yzu.scholarship.constant.C;
import cn.edu.yzu.scholarship.pojo.Menu;

import com.jfinal.core.Controller;

public class MenuCtrler extends Controller{
	
	public void scholarshipM() {
		List<Menu> menus = new ArrayList<Menu>();
		
		if(C.UT_TEACHER == (Integer)getSessionAttr("userType")) {
			menus.add(new Menu("奖助学金发放","scolarshipM/grant.html","icon-trophy"));
			menus.add(new Menu("奖助学金设置","scolarshipM/set.html","icon-cog"));
			menus.add(new Menu("发放历史","scolarshipM/files.html","icon-file"));
			menus.add(new Menu("数据统计","scolarshipM/chart.html","icon-pie"));
//			menus.add(new Menu("统计图表","scolarshipM/chart.html","icon-pie"));
//			menus.add(new Menu("历史列表","scolarshipM/files.html","icon-file"));
		}
		if(C.UT_STUDENT == (Integer)getSessionAttr("userType")) {
			menus.add(new Menu("发放历史","scolarshipM/files.html","icon-file"));
			menus.add(new Menu("用户密码修改","managerM/change.html","icon-pen2"));
		}
		if(C.UT_CONTROL == (Integer)getSessionAttr("userType")) {
			menus.add(new Menu("发放历史","scolarshipM/files.html","icon-file"));
			menus.add(new Menu("数据统计","scolarshipM/chart.html","icon-pie"));
		}



//		menus.add(new Menu("个人发放历史","scolarshipM/history.html","icon-backup"));
		renderJson(menus);
	}
	
	public void studentM() {
		List<Menu> menus = new ArrayList<Menu>();
//		if(C.UT_TEACHER == (Integer)getSessionAttr("userType")) {
		menus.add(new Menu("冻结状态管理","studentM/freeze.html","icon-unlock"));
		menus.add(new Menu("名单管理","studentM/group.html","icon-student"));
		menus.add(new Menu("导入学生","studentM/import.html","icon-import"));
		menus.add(new Menu("毕业生管理","studentM/graduate.html","icon-manage"));
//		}
		renderJson(menus);
	}
	
	public void collegeM() {
		List<Menu> menus = new ArrayList<Menu>();
//		if(C.UT_TEACHER == (Integer)getSessionAttr("userType")) {
		menus.add(new Menu("班级合并","collegeM/merge.html","icon-merge"));
		menus.add(new Menu("班级增加","collegeM/create.html","icon-add2"));
		menus.add(new Menu("班级删除","collegeM/delete.html","icon-remove2"));
		menus.add(new Menu("班级修改","collegeM/update.html","icon-pen"));
//		}
		renderJson(menus);
	}
	
	public void majorM() {
		List<Menu> menus = new ArrayList<Menu>();
//		if(C.UT_TEACHER == (Integer)getSessionAttr("userType")) {
		menus.add(new Menu("专业增加","majorM/create.html","icon-add2"));
		menus.add(new Menu("专业删除","majorM/delete.html","icon-remove2"));
		menus.add(new Menu("专业修改","majorM/update.html","icon-pen2"));
//		}
		renderJson(menus);
	}

	public void systemM() {
		List<Menu> menus = new ArrayList<Menu>();
//		if(C.UT_TEACHER == (Integer)getSessionAttr("userType")) {
		menus.add(new Menu("系统代码管理","managerM/code.html","icon-code"));
		menus.add(new Menu("系统数据管理","managerM/data.html","icon-data"));
		menus.add(new Menu("用户密码修改","managerM/change.html","icon-pen2"));
//		}
		renderJson(menus);

	}
	
	public void managerM() {
		List<Menu> menus = new ArrayList<Menu>();
//		if(C.UT_TEACHER == (Integer)getSessionAttr("userType")) {
		menus.add(new Menu("内控管理","managerM/control.html","icon-control"));
		menus.add(new Menu("发放历史","scolarshipM/files.html","icon-file"));
		menus.add(new Menu("数据统计","scolarshipM/chart.html","icon-pie"));
		menus.add(new Menu("用户密码修改","managerM/change.html","icon-pen2"));
//		}
		renderJson(menus);
		
	}

	public void personM() {
		List<Menu> menus = new ArrayList<Menu>();
		menus.add(new Menu("密码修改","managerM/change.html","icon-pen2"));
		renderJson(menus);

	}
}
